xdoclet
Class XDoclet

java.lang.Object
  |
  +--java.beans.beancontext.BeanContextChildSupport
        |
        +--java.beans.beancontext.BeanContextSupport
              |
              +--xdoclet.beans.BeanContextSupportEx
                    |
                    +--xdoclet.XDoclet
All Implemented Interfaces:
BeanContext, BeanContextChild, BeanContextServiceRevokedListener, BeanContextServicesListener, Collection, DesignMode, EventListener, PropertyChangeListener, Serializable, VetoableChangeListener, Visibility
Direct Known Subclasses:
AntDoclet

public class XDoclet
extends BeanContextSupportEx

This class as an entry-point for starting XDoclet. Adapter classes for particular environments such as various IDEs and Ant should be maintained separately. It's important to keep XDoclet's core environment agnostic.

This class also extends BeanContextSupport, and thereby this is actually a Collection, so we can store the plugins "in ourself". The main reason for extending BeanContextSupport is to be a ble to provide IDE integration in a convenient way. See the xdoclet.gui

package.

Version:
$Revision: 1.22 $
Author:
Aslak Hellesøy
See Also:
Plugin, ClasspathManager, PluginFactory, XDocletException, Serialized Form

Field Summary
static String XDOCLET_VERSION
           
 
Fields inherited from class java.beans.beancontext.BeanContextSupport
bcmListeners, children, designTime, locale, okToUseGui
 
Fields inherited from class java.beans.beancontext.BeanContextChildSupport
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport
 
Fields inherited from interface java.beans.beancontext.BeanContext
globalHierarchyLock
 
Fields inherited from interface java.beans.DesignMode
PROPERTYNAME
 
Constructor Summary
XDoclet()
          Creates a new XDoclet.
 
Method Summary
 Object createElement(String name)
          Called by AntProxy.createDynamicElement(java.lang.String) when a dynamic element is added to the XDoclet task.
protected  Collection createInvocations()
          Creates a Collection of Invocation.
 MetadataProvider createMetadataProvider(String name)
           
 Plugin createPlugin(String name)
          Adds a new Plugin.
 void execute()
          Executes all the plugins.
 void generateBuildXmlMaybe()
           
 File getBuildXmlDir()
           
 ClasspathManager getClasspathManager()
          Gets that ClasspathManager.
 void setBuildXmlDir(File buildXmlDir)
          If this is set, a build.xml file will be written out to the specified file.
 void setClasspath(String classpath)
          Sets the classpath under which XDoclet is run.
 void setFailure(Throwable failure)
           
 
Methods inherited from class xdoclet.beans.BeanContextSupportEx
add, getInvocations, getParent, setParent
 
Methods inherited from class java.beans.beancontext.BeanContextSupport
addAll, addBeanContextMembershipListener, avoidingGui, bcsChildren, bcsPreDeserializationHook, bcsPreSerializationHook, childDeserializedHook, childJustAddedHook, childJustRemovedHook, classEquals, clear, contains, containsAll, containsKey, copyChildren, createBCSChild, deserialize, dontUseGui, fireChildrenAdded, fireChildrenRemoved, getBeanContextPeer, getChildBeanContextChild, getChildBeanContextMembershipListener, getChildPropertyChangeListener, getChildSerializable, getChildVetoableChangeListener, getChildVisibility, getLocale, getResource, getResourceAsStream, initialize, instantiateChild, isDesignTime, isEmpty, isSerializing, iterator, needsGui, okToUseGui, propertyChange, readChildren, remove, remove, removeAll, removeBeanContextMembershipListener, retainAll, serialize, setDesignTime, setLocale, size, toArray, toArray, validatePendingAdd, validatePendingRemove, vetoableChange, writeChildren
 
Methods inherited from class java.beans.beancontext.BeanContextChildSupport
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, initializeBeanContextResources, isDelegated, releaseBeanContextResources, removePropertyChangeListener, removeVetoableChangeListener, serviceAvailable, serviceRevoked, setBeanContext, validatePendingSetBeanContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.beans.beancontext.BeanContextChild
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

XDOCLET_VERSION

public static final String XDOCLET_VERSION
See Also:
Constant Field Values
Constructor Detail

XDoclet

public XDoclet()
Creates a new XDoclet.

Method Detail

setBuildXmlDir

public final void setBuildXmlDir(File buildXmlDir)
If this is set, a build.xml file will be written out to the specified file.

Parameters:
buildXmlDir - the file where build.xml should be written.

getBuildXmlDir

public final File getBuildXmlDir()

createMetadataProvider

public MetadataProvider createMetadataProvider(String name)
                                        throws XDocletException
XDocletException

setFailure

public void setFailure(Throwable failure)

setClasspath

public void setClasspath(String classpath)
                  throws XDocletException
Sets the classpath under which XDoclet is run.

Parameters:
classpath - the classpath under which XDoclet is run
XDocletException

getClasspathManager

public ClasspathManager getClasspathManager()
Gets that ClasspathManager.

Returns:
the ClasspathManager.

execute

public void execute()
             throws IOException,
                    XDocletException
Executes all the plugins.

Throws:
XDocletException - if execution fails.
IOException

generateBuildXmlMaybe

public void generateBuildXmlMaybe()
                           throws IOException,
                                  XDocletException
IOException
XDocletException

createElement

public Object createElement(String name)
                     throws XDocletException
Called by AntProxy.createDynamicElement(java.lang.String) when a dynamic element is added to the XDoclet task. This method will route the call to createPlugin(java.lang.String).

Parameters:
name - the name of the plugin to create.
Returns:
a Plugin object mapped to name.
Throws:
XDocletException

createPlugin

public Plugin createPlugin(String name)
                    throws XDocletException
Adds a new Plugin.

Parameters:
name - Plugin name
Returns:
a Plugin instance
Throws:
XDocletException - plugin creation fails.
See Also:
PluginFactory.createPlugin(java.lang.String, xdoclet.XDoclet)

createInvocations

protected Collection createInvocations()
Description copied from class: BeanContextSupportEx
Creates a Collection of Invocation. These serve as dynamic factories for creation of sub elements. The default implementation returns an empty Collection. Should be overridden by subclasses that accept sub elements.

Overrides:
createInvocations in class BeanContextSupportEx
Returns:
a Collection of Invocation


Copyright © 2000-2003 XDoclet Team. All Rights Reserved.